<?php

use yii\db\Migration;
use yii\db\Schema;

/**
 * Class m210423_071125_ADD_FIELD_USER
 */
class m210423_071125_ADD_FIELD_USER extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {

        $this->addColumn('{{user}}', 'name', Schema::TYPE_STRING. "(45) NOT NULL COMMENT '姓名' AFTER schoolid");
        $this->createIndex('user','user',['schoolid'],true);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m210423_071125_ADD_FIELD_USER cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m210423_071125_ADD_FIELD_USER cannot be reverted.\n";

        return false;
    }
    */
}
